﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SIS_Wcf_Server.Model
{
    public interface IData
    {

        //Information packages
       

        RestInformation CreateInformation(RestInformation information);


        net OpretNetSoegning(net netData);


        //Check at gps positionen ikke findes i databasen inden den oprettes.
        gpsPositioner OpretGpsSoegning(gpsPositioner position);

        /// <summary>
        /// Gemmer lokationer fra en søgning eller informations oprettelse. Hvis der er flere lokationer relateres de til hinanden.
        /// </summary>
        /// <param name="locations"></param>
        void SaveAndRelateLocations(List<Model.Lokation> locations);


        /// <summary>
        /// Henter alle de informations pakker der matcher lokationerne i søgning. Medtager tags. 
        /// </summary>
        /// <param name="locations"></param>
        /// <returns></returns>
        List<Information> GetInformationForLocations(List<Model.Lokation> locations);

        /// <summary>
        /// Returnere alle lokationer.
        /// </summary>
        /// <returns></returns>
        List<Lokation> GetAllLocations();

        /// <summary>
        /// Returnere de seneste nets der har været søgt på.
        /// </summary>
        /// <returns></returns>
        List<net>      GetLatestNets( );

        /// <summary>
        /// Hent alle net som har type <code>type</code>, og relateret til <code>location</code>
        /// </summary>
        /// <param name="location"></param>
        /// <param name="type"></param>
        /// <returns></returns>
        List<net> GetNetForLocationByType(Lokation location, string type);

        /// <summary>
        /// flush changes.
        /// </summary>
        void store();

        /// <summary>
        /// Flag lokation as none geo coded. ( Means indexer will find it on next run )
        /// </summary>
        /// <param name="l"></param>
        void tagLokationAsNoneGeoCoded(Lokation l);

        /// <summary>
        /// Find the corsponding net for a location.
        /// </summary>
        /// <param name="l">the location</param>
        /// <returns>a net</returns>
        net getNetFromLokation(Lokation l);
    }
}
